/**
 
 **/
package edu.towson.cosc603.coffeemaker;

import static org.junit.Assert.*;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
   @author Sushma
 
 **/
public class InventoryTest extends TestCase{

        private Inventory inventory;
        private Recipe recipeLatte;
        /**
         * @throws java.lang.Exception
         */
        @Before
        public void setUp() throws Exception {
                
                inventory = new Inventory();
                recipeLatte = new Recipe();
                recipeLatte.setName("Latte");
                recipeLatte.setPrice(70);
                recipeLatte.setAmtCoffee(6);
                recipeLatte.setAmtMilk(3);
                recipeLatte.setAmtSugar(3);
                recipeLatte.setAmtChocolate(3);
                
        }

        /**
          @throws java.lang.Exception
         **/
        
        @After
        public void tearDown() throws Exception {
        }

        /**
          It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getChocolate()}.
         **/
        
        @Test
        public void testGetChocolate() {
                inventory.setChocolate(60);
                assertEquals(60, inventory.getChocolate());
                
        }
        
        /**
          It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getChocolate()}.
         **/
        @Test
        public void testGetChocolate2() {
                inventory.setChocolate(-60);
                assertEquals(0, inventory.getChocolate());
                
        }

        

        /**
         It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getCoffee()}.
         **/
        
        @Test
        public void testGetCoffee() {
                inventory.setCoffee(45);
                assertEquals(45, inventory.getCoffee());
                
        }


        /**
         It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getCoffee()}.
         **/
        @Test
        public void testGetCoffee2() {
                inventory.setCoffee(-45);
                assertEquals(0, inventory.getCoffee());
                
        }
        
        /**
         It is the Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getMilk()}.
         **/
        
        @Test
        public void testGetMilk() {
                inventory.setMilk(50);
                assertEquals(50, inventory.getMilk());
                
        }

        /**
          It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getMilk()}.
         **/
        @Test
        public void testGetMilk2() {
                inventory.setMilk(-50);
                assertEquals(0, inventory.getMilk());
                
        }

        

        /**
         It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getSugar()}.
         **/
        
        @Test
        public void testGetSugar() {
                
        }

        /**
         It is the test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
         **/
        
        @Test
        public void testEnoughIngredients() {
                
                
                
                inventory.setCoffee(1);
                inventory.setMilk(1);
                inventory.setSugar(1);
                inventory.setChocolate(1);
                
                
                assertFalse(inventory.enoughIngredients(recipeLatte));
                
        }
        /**
         It is the Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#toString()}.
         **/
        @Test
        public void testtoString() {
        
                
                inventory.setCoffee(25);
                inventory.setMilk(25);
                inventory.setSugar(25);
                inventory.setChocolate(25);
                
                String check = "Coffee: 25" + "\n" +
                                "Milk: 25" + "\n" +
                                "Sugar: 25" + "\n" +
                                "Chocolate: 25" + "\n";
                
                assertEquals(check, inventory.toString());
                

        }
        }